//
//  Seach_Filtrate_Model_WX.m
//  ZITHER
//
//  Created by weixin on 2019/3/20.
//  Copyright © 2019 weixn. All rights reserved.
//

#import "Seach_Filtrate_Model_WX.h"

@implementation Seach_Filtrate_Model_WX

+ (instancetype)defaultManager {
    
    static Seach_Filtrate_Model_WX *manager = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        manager = [[Seach_Filtrate_Model_WX alloc] init];
        
    });
    return manager;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {}

- (NSString *)description {
    
    return [self yy_modelDescription];
}

- (void)encodeWithCoder:(NSCoder *)aCoder {
    [self yy_modelEncodeWithCoder:aCoder];
}

- (id)initWithCoder:(NSCoder *)aDecoder {
    self = [super init];
    return [self yy_modelInitWithCoder:aDecoder];
}

- (NSMutableArray *)arrBrandSelect{
    if (!_arrBrandSelect) {
        _arrBrandSelect = [[NSMutableArray alloc]init];
    }
    return _arrBrandSelect;
}

-(Seach_SearchResultTopBar_Model_WX *)SearchResultTopBarModel{
    if (!_SearchResultTopBarModel) {
        _SearchResultTopBarModel = [[Seach_SearchResultTopBar_Model_WX alloc]init];
    }
    return _SearchResultTopBarModel;
}

-(void)claenData{
    self.SearchResultTopBarModel = [[Seach_SearchResultTopBar_Model_WX alloc]init];
    
    NSArray *arrSelect = self.arrBrandSelect;
    
    for (int i =0; i<arrSelect.count; i++) {
        Seach_FiltrateAttributeSubData_Model_WX *model = arrSelect[i];
        model.isSelect = NO;
        NSArray *arr =  self.arrAttribute[0].child[model.indexPath.section].data;
        for (int i = 0; i< arr.count; i++) {
            Seach_FiltrateAttributeSubData_Model_WX *model3 = arr[i];
            if ([model.labelValue[0] isEqualToString:model3.labelValue[0]]) {
                model3 = model;
                break;
            }
        }
    }
    [self.arrBrandSelect removeAllObjects];
    self.arrBrandSelectAdd = nil;
    self.arrBrandSelect = [[NSMutableArray alloc]init];
    self.arrBrandBigWord = [[NSArray alloc]init];
    self.arrAttribute = [[NSMutableArray alloc]init];
    //    self.SearchResultTopBarModel.keyWord = @"";
    //    self.SearchResultTopBarModel.sotr = 0;
    //    self.ResultCont
    
    
}


-(void)resetData{
    NSArray *arrSelect = kUSER_Filtrate_MANAGER.arrBrandSelect;
    
    for (int i =0; i<arrSelect.count; i++) {
        Seach_FiltrateAttributeSubData_Model_WX *model = arrSelect[i];
        model.isSelect = NO;
        NSArray *arr =  kUSER_Filtrate_MANAGER.arrAttribute[0].child[model.indexPath.section].data;
        for (int i = 0; i< arr.count; i++) {
            Seach_FiltrateAttributeSubData_Model_WX *model3 = arr[i];
            if ([model.labelValue[0] isEqualToString:model3.labelValue[0]]) {
                model3 = model;
                break;
            }
        }
    }
    [kUSER_Filtrate_MANAGER.arrBrandSelect removeAllObjects];
}
@end

@implementation Seach_FiltrateAttribute_Model_WX

+ (NSDictionary *)modelContainerPropertyGenericClass {
    return @{@"child": [Seach_FiltrateAttributeSub_Model_WX class]};
}
@end

@implementation Seach_FiltrateAttributeSub_Model_WX

+ (NSDictionary *)modelContainerPropertyGenericClass {
    return @{@"data": [Seach_FiltrateAttributeSubData_Model_WX class]};
}
@end

@implementation Seach_FiltrateAttributeSubData_Model_WX


@end

@implementation Seach_SearchResultTopBar_Model_WX


@end

